<layout name="layout" />
<link rel="stylesheet" href="/Css/home.css" type="text/css">
<span class="system"></span>
<br class="clearall" />
<div id="contentwrapper" class="contentwrapper nopadding">
	<div class="main"> <!-- main chart area-->
		<div class="dashboard" style="margin-top:30px;">
			<div style="margin-bottom:30px;" >
			<table class="metrotable " id="metrotable_top" border="1px" cellpadding="0" cellspacing="0"  >
				<colgroup >
					<col class="con1" width="100px">
					<col class="con0" width="100px">
					<col class="con1" width="100px">
					<col class="con0" width="100px">
					<col class="con1" width="100px">
					<col class="con0" width="100px">
					<col class="con1" width="100px">
				</colgroup>
				<thead>
					<tr>
						<th class="head1">浏览量</th>
						<th class="head0">点击量</th>
						<th class="head1">点击率</th>
						<th class="head0">每点击花费</th>
						<th class="head1">千次展现花费</th>
						<th class="head0" >总成交笔数</th>
						<th class="head1" >总收藏次数</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td id="impressions_sum" class="indicators"></td>
						<td id="click_sum" class="indicators"></td>
						<td id="ctr_sum" class="indicators"></td>
						<td id="cpc_sum" class="indicators"></td>
						<td id="cpm_sum" class="indicators"></td>
						<td id="pay_count_sum" class="indicators"></td>
						<td id="fav_total_count_sum" class="indicators"></td>
					</tr>
				</tbody>
			</table>
					<div class="widget" style="width:37%;float:right;">
						<div class="earnings">
							数据正在加载中……
						</div>
					</div>
					<br clear="all">
			</div>

			<div class="filemgr_category" >
				<ul id="indicators" >
					<li>
						<a rel="cost" href="javascript:void(0);">花费</a>
					</li>
					<li>
						<a rel="roi" href="javascript:void(0);">投入产出比</a>
					</li>
					<li>
						<a rel="click" href="javascript:void(0);">点击量</a>
					</li>
					<li>
						<a rel="cpc" href="javascript:void(0);">平均点击花费</a>
					</li>
					<li>
						<a rel="sales" href="javascript:void(0);">成交</a>
					</li>
					<li>
						<a rel="impressions" href="javascript:void(0);">展现量</a>
					</li>
					
					<li>
						<a rel="ctr" href="javascript:void(0);">点击率</a>
					</li>
					<li>
						<a rel="cpm" href="javascript:void(0);">千次展现花费</a>
					</li>
				</ul>
				<div style="float:right;" id="table_datepicker"></div>
			</div>
			<br clear="all">
			<div class="graph">
				<div class="five_sixth" id="chartplace" style="height: 260px; padding: 0px; position:relative;margin-right: 35px;"></div>
				<div class="legend one_sixth last">
					<div class="statics cost">
						<span class="indicators" id="cost_sum"></span><h4>总花费</h4>
					</div>
					<div class="statics sales" style="margin-top:15px;">
						<span class="indicators" id="sales_sum"></span><h4>总成交</h4>
					</div>
					<div class="statics roi" style="margin-top:15px;">
						<span class="indicators" id="roi_sum"></span><h4>投入产出比</h4>
					</div>
				</div>
			</div>
			<br clear="all">
			<br>
			<hr style="height:3px;border:none;border-top:3px double #f0f0f0;" />
			<div id="campaign_report">
				
			</div>
		</div><!--two_third dashboard_left -->

	</div><!--one_third last-->
</div><!-- main chart area-->
<div id="activities" class="subcontent" style="display: none;">
&nbsp;
</div><!-- #activities -->


<script type="text/javascript">
	var user_id = {$me.user_id};
	$(document).ready(function(){
		homeinstance = home.index($('.bodywrapper'), {init: init, userfirst: userfirst, user_id: user_id});
	});
</script>

<script id="template_welcome" type="text/html">
	<div class="welcome">
		<div class="welcome-content">
			<div class="welcome-left">
				<div class="content">
					亲爱的掌柜:<br><br>
					&nbsp&nbsp&nbsp&nbsp感谢您的信任,选择了云智投。麻烦<br><br>
					您完善联系信息，方便我们后期对您的操<br><br>
					作实时跟进，并及时通知您云智投专家的<br><br>
					新玩法。
				</div>
			</div>
			<div class="welcome-right">
				<div class="title">联系方式</div>
				<div class="inputs">
					<!--<form action="{:U('Index/userdetail')}" method="post" name="reg" onsubmit="return checkForm()">-->
					<form id='myform' name="reg">
						<div class="input-line">
							<div class="input-label">手机号:</div>
							<div class="input-container">
								<input type="text" id="phone" name="tel"  placeholder="请输入手机号" error-span="tel_info">
							</div>
						</div>
						<span class="tel_info"></span>

						<div class="input-line">
							<div class="input-label">QQ号:</div>
							<div class="input-container">
								<input type="text" id="QQ" name="qq" placeholder="请输入QQ号" error-span="qq_info">
							</div>
						</div>
						<span class="qq_info"></span>
						<div class="input-line">
							<div class="buttons-container">
								<a class="btn btn_grey btn-submit" href="javascript:;;;;">提交</a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</script>

<script id="template_campaign_reports" type="text/html" content="/Template/compaign_reports.html">
	<% for(var i = 0; i < data.length; i ++) { %>
	<tr>
		<% if (data[i].online_status == 'online') { %>
		<td class="green"><strong>推广中</strong></td>
		<% }else{ %>
		<td class="orange"><strong>暂停</strong></td>
		<% } %>
		<td>
			<span class="cilckChange" rel="tipsy" title="<%= data[i].title %>" data-editor-name="title" data-campaign-id="<%= data[i].campaign_id %>">
				<input class="title" type="text" value="<%= data[i].title %>" readonly="readonly" data-input="<%= data[i].title %>">
			</span>
		</td>
		<td>
			<span class="cilckChange change2" data-editor-name="budget" data-campaign-id="<%= data[i].campaign_id %>">
				<input class="title budget" type="text" value="<%= data[i].budget %>" readonly="readonly" data-input2="<%= data[i].budget %>">元
			</span>
		</td>
		<td>计算机 移动设备</td>
		<td><%= data[i].report.impressions %></td>
		<td><%= data[i].report.click %></td>
		<td><%= data[i].report.ctr %>%</td>
		<td>￥<%= data[i].report.cost %></td>
		<td><%= data[i].report.roi %></td>
		<td><%= data[i].report.cvr %></td>
		<td>
			<a class="btn btn3 btn_grey" href="/campaign/manage?campaign_id=<%= data[i].campaign_id %>">管理</a>
			<a class="btn btn3 btn_grey setStatus" data-title="<%= data[i].title %>" data-campaign_id="<%= data[i].campaign_id %>" data-status="<%= data[i].online_status %>" href="javascript:;" style="background-color: #5CBAE6">
				<% if (data[i].online_status == 'online') { %>暂停推广<% }else{ %>开启推广<% } %>
			</a>
		</td>
	</tr>
	<%}%>
</script>
<script id="template_campaign_reporter" type="text/html" content="/Template/compaign_report_list.html">
	<table class="metrotable overviewtable_plan" style="width:100%;border:0;cellpadding:0;cellspacing:0;">
		<colgroup>
			<col class="con0" width="5%"><!-- 状态 -->
			<col class="con1" width="13%"><!-- 推广计划名称 -->
			<col class="con1" width="7%"><!-- 日限额 -->
			<col class="con0" width="17%"><!-- 投放平台 -->
			<col class="con1" width="7%"><!-- 展现量 -->
			<col class="con0" width="7%"><!-- 点击量 -->
			<col class="con1" width="7%"><!-- 点击率 -->
			<col class="con0" width="7%"><!-- 花费 -->
			<col class="con1" width="7%"><!-- 投入产出比 -->
			<col class="con0" width="7%"><!-- 点击转化率 -->
			<col class="con1" width="16%"><!-- 操作 -->
		</colgroup>
		<thead>
		<tr class="metrotable_main">
			<th class="head0"><strong>状态</strong></th>
			<th class="head1"><strong>推广计划名称</strong></th>
			<th class="head1"><strong>日限额</strong></th>
			<th class="head0"><strong>投放平台</strong></th>
			<th class="head1"><strong>展现量</strong></th>
			<th class="head0"><strong>点击量</strong></th>
			<th class="head1"><strong>点击率</strong></th>
			<th class="head0"><strong>花费</strong></th>
			<th class="head1"><strong>投入产出比</strong></th>
			<th class="head0"><strong>点击转化率</strong></th>
			<th class="head1"><strong>操作</strong></th>
		</tr>
		</thead>
		<tbody></tbody>
	</table>
</script>

<script id="user_money_report" type="text/html">
	<div class="one_half" style="width:30%">
		<h4>昨日费用</h4>
		<h2><%= yesterday_cost %>元</h2>
	</div>
	<div class="one_half" style="width:30%">
		<h4>实时扣费</h4>
		<h2><%= real_day_cost %>元</h2>
	</div>
	<div class="one_half" style="width:30%">
		<h4>账户余额</h4>
		<h2><%= balance %>元</h2>
	</div>
</script>
<script id="system_notice" type="text/html">
	<ul class="massage_box">
	<% for(var i=0 ; i < data.total_item ;i++){%>
		<li><%=data.items[i]%></li>
	<%}%>
	</ul>
</script>
